/*
 *  This file is part of LifeBudget - Copyright 2010 Clifton Eaton
 *  ------------------------------------------------------------------
 *  LifeBudget is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  LifeBudget is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with LifeBudget.  If not, see <http://www.gnu.org/licenses/>.
 */
package org.lifebudget.app.persistence;

import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

/**
 * The Class EMF provides a utility for holding a static instance of the 
 * {@link EntityManagerFactory} used by this app.
 */
public class EMF {
    
    /** The Constant emfInstance. */
    private static final EntityManagerFactory emfInstance =
        Persistence.createEntityManagerFactory("transactions-optional");

    /**
     * Instantiates a new eMF.
     */
    private EMF() {}

    /**
     * Gets the static instance of the <code>EntityManagerFactory</code>.
     *
     * @return the entity manager factory
     */
    public static EntityManagerFactory get() {
        return emfInstance;
    }

}
